<?php

namespace Controller;

class Sitemap extends App {
    public $layout = false;

    public function index() {
        $this->autoRender = false;
        header('Content-Type:application/xml; charset=utf-8');
        $urls = array('/', '/kontakt');

        //pages
        $this->loadModel('Page');
        foreach ($this->Page->find() as $page) {
            $urls[] = '/' . $page['id'] . '/' . $page['title'];
        }

        $this->set('urls', $urls);

        echo $this->render();
    }

}